import request from '@/utils/request'

export function getList(params) {
  return request({
    url: '/cicd/demandorder/',
    method: 'get',
    params
  })
}
export function addRow(params) {
  return request({
    url: '/cicd/demandorder/',
    method: 'post',
    data: params
  })
}

export function getDetail(params) {
  return request({
    url: '/cicd/demandorder/' + params.id + '/',
    method: 'get',
    data: params
  })
}

export function getWorkOrder(params) {
  return request({
    url: '/cicd/workorder/',
    method: 'get',
    params
  })
}

export function getSteps(params) {
  return request({
    url: 'cicd/demandorder/' + params.id + '/steps/',
    method: 'get',
    params
  })
}

export function doStep(params) {
  return request({
    url: 'cicd/demandorder/' + params.id + '/do/',
    method: 'post',
    data: params
  })
}

export function addWorkOrders(params) {
  return request({
    url: 'cicd/demandorder/' + params.id + '/recordorders/',
    method: 'post',
    data: params
  })
}

export function getServiceList(params) {
  return request({
    url: 'res/lob/service/',
    method: 'get',
    params
  })
}

export function getImageTagList(params) {
  return request({
    url: 'cicd/demandorder/' + params.id + '/repotags/',
    method: 'get',
    params
  })
}

export function getLatestImageTag(params) {
  return request({
    url: 'cicd/demandorder/' + params.id + '/latesttag/',
    method: 'get',
    params
  })
}
